﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Business.Managers;

namespace Young3.FMSearch.Business.Entities.InGame
{
    public static class Global
    {
        public static DateTime IngameDate
        {
            get
            {
                return ProcessManager.ReadDateTime((int)MemoryAddresses.CurrentDateTime + ProcessManager.getVersionOffset);
            }
        }

        public static int getObjectAddress
        {
            get
            {
                if (ProcessManager.FmVersion.Equals("9.3.0"))
                    return ProcessManager.ReadInt32((int)MemoryAddresses.ActiveObject + ProcessManager.getVersionOffset - 0xf0);
                else if (ProcessManager.FmVersion.Equals("9.2.0"))
                    return ProcessManager.ReadInt32((int)MemoryAddresses.ActiveObject + ProcessManager.getVersionOffset - 0x30);
                else
                    return ProcessManager.ReadInt32((int)MemoryAddresses.ActiveObject + ProcessManager.getVersionOffset);
            }
        }
    }
}
